#pragma once

#include "Win32Base.h"

START_NAMESPACE

	//---------------------------------------------------------------------------------------
	class CWin32Dialog : public CWindowBase
	{
	public:
		CWin32Dialog();
		CWin32Dialog(HINSTANCE hInstance,UINT TemplateID,CWindowBase *pWndParent = NULL);
		virtual ~CWin32Dialog();

		bool Create(HINSTANCE hInstance,UINT TemplateID,CWindowBase *pWndParent = NULL);
		bool Create(HINSTANCE hInstance,UINT TemplateID,HWND hParentWnd);
		int  DoModal();
		void EndDialog(int exit_code);

	public:
		virtual LRESULT OnInitDialog(WPARAM wParam,LPARAM lParam);
		virtual LRESULT OnOk(WPARAM wParam,LPARAM lParam);
		virtual LRESULT OnCancel(WPARAM wParam,LPARAM lParam);

	public:
		virtual HWND GetDlgItem(UINT id);

		virtual void EnableDlgItem(UINT id,bool bEnable = true);

		virtual bool SetDlgItemInt(UINT id,int value,bool bSigned = true);
		virtual bool SetDlgItemFloat(UINT id,float value);
		virtual int  GetDlgItemInt(UINT id,bool bSigned = true);
		virtual bool SetDlgItemText(UINT id,LPCSTR str);
		virtual std::string GetDlgItemText(UINT id);

		virtual void SetCheck(UINT id,bool bCheck);
		virtual bool GetCheck(UINT id);

		virtual void SetChildWindowNationalFont(int nSize);

		// combo box
		virtual int		Combo_AddString(UINT id,LPCSTR str);
		virtual void	Combo_DeleteAll(UINT id);
		virtual int		Combo_GetCurSel(UINT id);

	protected:
		UINT	m_nTemplateID;
		int		m_nDoModalResult;
		HWND	m_hParent;
	};

END_NAMESPACE